/**
 * Project Name:sc-parent-service
 * File Name:ProbabilityCalculator.java
 * Package Name:com.sc.probabilityfactory
 * Date:2018年6月29日上午9:26:57
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.probabilitycount;

import java.util.ArrayList;
import java.util.List;

import com.sc.pojo.Customer;
import com.sc.probability.Probability;

/**
 * Description: 单个对象（客户）概率的计算器  <br/>
 * Date:     2018年6月29日 上午9:26:57 <br/>
 * @author   tianyongxu
 * @version
 * @see
 */
public class ProbabilityCalculator {
    
    private static List<Probability> list = new ArrayList<Probability>();

    public ProbabilityCalculator(List<Probability> list) {
        this.list = list;
    }

    public static float calculate(Customer customer){
        float result = 0.0f;
        for(Probability pro:list){
            result += pro.getProbability(customer);
        }
        return result;
    }
}

